package org.news.beans;

import java.util.List;

/**
 * Created by lenovo on 2016/5/11.
 */
public class PagesModel<T> {
    private Long pageNum;
    private Long pageCount;
    private Long totalCount;
    private  List<T> data;

    public PagesModel() {

    }
    public PagesModel(Long pageNum, Long pageCount, Long totalCount,
                      List<T> data) {
        this.pageNum = pageNum;
        this.pageCount = pageCount;
        this.totalCount = totalCount;
        this.data = data;
    }
    public Long getPageNum() {
        return pageNum;
    }
    public void setPageNum(Long pageNum) {
        this.pageNum = pageNum;
    }
    public Long getPageCount() {
        return pageCount;
    }
    public void setPageCount(Long pageCount) {
        this.pageCount = pageCount;
    }
    public Long getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
    }
    public List<T> getData() {
        return data;
    }
    public void setData(List<T> data) {
        this.data = data;
    }
    public int getTotalPages(){
        return (int)Math.ceil((double)totalCount / pageCount);
    }
}
